#include <iostream>
#include <list>

using namespace std;

int main()
{
	list<size_t> l{ 1, 2, 3, 4, 5 };
	for (auto i : l)
		cout << i << " ";
	cout << endl;
	auto it2 = next(l.begin(), 2);
	auto it2_1 = it2;
	auto it4 = next(l.begin(), 4);
	auto it4_1 = it4;
	cout << *it2 << " " << *it2_1 << " " << *it4 << " "  << *it4_1  << endl;
	iter_swap(it2, it4);
	for (auto i : l)
		cout << i << " ";
	cout << endl;
	cout << *it2 << " " << *it2_1 << " " << *it4 << " " << *it4_1 << endl;

	return 0;
}